package com.repair.repairSys.service.impl;

import java.util.List;
import com.repair.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.repair.repairSys.mapper.RepairFeedbackMapper;
import com.repair.repairSys.domain.RepairFeedback;
import com.repair.repairSys.service.IRepairFeedbackService;

/**
 * 意见反馈Service业务层处理
 * 
 * @author repair
 * @date 2024-12-05
 */
@Service
public class RepairFeedbackServiceImpl implements IRepairFeedbackService 
{
    @Autowired
    private RepairFeedbackMapper repairFeedbackMapper;

    /**
     * 查询意见反馈
     * 
     * @param userId 意见反馈主键
     * @return 意见反馈
     */
    @Override
    public RepairFeedback selectRepairFeedbackByUserId(Long userId)
    {
        return repairFeedbackMapper.selectRepairFeedbackByUserId(userId);
    }

    /**
     * 查询意见反馈列表
     * 
     * @param repairFeedback 意见反馈
     * @return 意见反馈
     */
    @Override
    public List<RepairFeedback> selectRepairFeedbackList(RepairFeedback repairFeedback)
    {
        return repairFeedbackMapper.selectRepairFeedbackList(repairFeedback);
    }

    /**
     * 新增意见反馈
     * 
     * @param repairFeedback 意见反馈
     * @return 结果
     */
    @Override
    public int insertRepairFeedback(RepairFeedback repairFeedback)
    {
        repairFeedback.setCreateTime(DateUtils.getNowDate());
        return repairFeedbackMapper.insertRepairFeedback(repairFeedback);
    }

    /**
     * 修改意见反馈
     * 
     * @param repairFeedback 意见反馈
     * @return 结果
     */
    @Override
    public int updateRepairFeedback(RepairFeedback repairFeedback)
    {
        return repairFeedbackMapper.updateRepairFeedback(repairFeedback);
    }

    /**
     * 批量删除意见反馈
     * 
     * @param userIds 需要删除的意见反馈主键
     * @return 结果
     */
    @Override
    public int deleteRepairFeedbackByUserIds(Long[] userIds)
    {
        return repairFeedbackMapper.deleteRepairFeedbackByUserIds(userIds);
    }

    /**
     * 删除意见反馈信息
     * 
     * @param userId 意见反馈主键
     * @return 结果
     */
    @Override
    public int deleteRepairFeedbackByUserId(Long userId)
    {
        return repairFeedbackMapper.deleteRepairFeedbackByUserId(userId);
    }
}
